function setHtmlFontSize() {
  var baseSize = 100
  var baseWidth = 750
  var htmlWidth =
    document.documentElement.clientWidth || document.body.clientWidth
  var htmlDom = document.getElementsByTagName('html')[0]
  htmlDom.style.fontSize = (htmlWidth / baseWidth) * baseSize + 'px'
}
setHtmlFontSize()
window.onresize = setHtmlFontSize

function goIndex() {
  window.location.href = './index.html'
}

function goIntroductionPage(){
  window.location.href = './introductionPage.html'
}

function lookBigPic(source) {
  var modal = document.getElementById('modal')
  if (!modal) {
    var modalEl = document.createElement('div')
    modalEl.setAttribute('id', 'modal')
    modalEl.addEventListener('click', function() {
      modalEl.style.display = 'none'
    })
    var maskEl = document.createElement('div')
    maskEl.setAttribute('class', 'mask')
    var imgEl = document.createElement('img')
    imgEl.setAttribute('class', 'img')
    imgEl.setAttribute('src', source.src)

    modalEl.appendChild(maskEl)
    modalEl.appendChild(imgEl)
    document.body.appendChild(modalEl)
  } else {
    modal.children[1].src = source.src
    modal.style.display = 'flex'
  }
}
